package com.ljn.core.dto.common.utils.assmbler;

import com.ljn.core.dto.Teacher;
import com.ljn.core.dto.common.User;
import com.ljn.core.dto.common.command.usercommand.LoginCommand;
import com.ljn.core.dto.common.command.usercommand.Registercommand;
import org.springframework.beans.BeanUtils;

/**
 * Created by liujunnan on 2017/11/7.
 */
public class UserAssmbler {
    public static User toUser(Registercommand registerCommand) {
        Teacher teacher = new Teacher();
        BeanUtils.copyProperties(registerCommand, teacher);
        return teacher;
    }
    public static User toUserLogin(LoginCommand loginCommand) {
        User user = new User();
        BeanUtils.copyProperties(loginCommand, user);
        return user;
    }
}

